package cn.agiledata.bank.common.tag;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.BodyTagSupport;

import org.apache.struts.taglib.TagUtils;

import cn.agiledata.bank.common.dao.BankTemplate;
import cn.agiledata.bank.common.util.ForeDict;
import cn.agiledata.bank.hibernateBean.BankInfo;
import com.vnv.infrastructure.logic.IPBAppFactory;

public class BankNameTag extends BodyTagSupport {

	public int doEndTag() throws JspException {
		BankTemplate bankTemplate = (BankTemplate) IPBAppFactory.getObj(ForeDict.BANK_TEMPLATE);
		String bankSeq = this.getBodyContent().getString();
		BankInfo bankInfo = bankTemplate.getBankInfo(bankSeq);
		TagUtils.getInstance().write(this.pageContext,
				bankInfo.getBankName());
		return super.doEndTag();
	}
}
